<template>
  <div class="existing wd1200">
    <v-title color="#FF8C1A" background-color="#FFF3E8" title="融资企业" class="title" />
    <el-row class="list-box" :gutter="20">
      <el-col v-for="(item,index) in list1" :key="'l'+index" :span="item.span">
        <div class="classify" @click="toUrl(item)">
          <div>
            <img :src="require(`@/assets/images/busNeighbors/open1/${index+1}.png`)" alt="">
            <span>{{ item.title }}</span>
          </div>
          <div>
            <span v-loading="loading" class="color-o" style="text-align: end;display: inline-block;min-width: 80px">{{ counts[index] }}家</span>
            <img src="../../../../assets/images/busNeighbors/r.png" alt="" class="right-icon">
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import vTitle from '@/components/busNeighbors/title'
import { build_qimingpian_history_rongzi_com_count, build_qimingpian_history_rongzi_type_count, build_opt_ent_partner_std_com_count, build_company_branch_com_count, build_land_result_announcement_com_count, build_company_ydzb_count } from '@/api/busNeighbors'
export default {
  name: 'Existing',
  components: {
    vTitle
  },
  data() {
    return {
      list1: [{
        icon: require('@/assets/images/busNeighbors/1.png'),
        title: '融资企业',
        num: '2000家',
        span: 24,
        api: 'build_qimingpian_history_rongzi_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_qimingpian_history_rongzi_com_capital_range',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_qimingpian_history_rongzi_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/2.png'),
        title: '种子轮/天使轮',
        num: '2000家',
        span: 8,
        api: 'build_qimingpian_history_rongzi_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_qimingpian_history_rongzi_com_capital_range',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: '种子轮/天使轮',
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_qimingpian_history_rongzi_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: '种子轮/天使轮',
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          round: '种子轮/天使轮',
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/1.png'),
        title: 'A轮',
        num: '2000家',
        span: 8,
        api: 'build_qimingpian_history_rongzi_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_qimingpian_history_rongzi_com_capital_range',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: 'A轮',
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_qimingpian_history_rongzi_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: 'A轮',
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          round: 'A轮',
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/2.png'),
        title: 'B轮 ',
        num: '2000家',
        span: 8,
        api: 'build_qimingpian_history_rongzi_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_qimingpian_history_rongzi_com_capital_range',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: 'B轮',
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_qimingpian_history_rongzi_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: 'B轮',
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          round: 'B轮',
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/2.png'),
        title: 'C轮',
        num: '2000家',
        span: 8,
        api: 'build_qimingpian_history_rongzi_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_qimingpian_history_rongzi_com_capital_range',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: 'C轮',
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_qimingpian_history_rongzi_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: 'C轮',
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          round: 'C轮',
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/1.png'),
        title: 'E轮及以上',
        num: '2000家',
        span: 8,
        api: 'build_qimingpian_history_rongzi_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_qimingpian_history_rongzi_com_capital_range',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: 'E轮及以上',
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_qimingpian_history_rongzi_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: 'E轮及以上',
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          round: 'E轮及以上',
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/2.png'),
        title: '并购/合并',
        num: '2000家',
        span: 8,
        api: 'build_qimingpian_history_rongzi_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_qimingpian_history_rongzi_com_capital_range',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: '并购/合并',
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_qimingpian_history_rongzi_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: '并购/合并',
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          round: '并购/合并',
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/2.png'),
        title: '战略融资/投资',
        num: '2000家',
        span: 8,
        api: 'build_qimingpian_history_rongzi_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_qimingpian_history_rongzi_com_capital_range',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: '战略融资/投资',
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_qimingpian_history_rongzi_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: '战略融资/投资',
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          round: '战略融资/投资',
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/1.png'),
        title: '股权融资/转让',
        num: '2000家',
        span: 8,
        api: 'build_qimingpian_history_rongzi_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_qimingpian_history_rongzi_com_capital_range',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: '股权融资/转让',
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_qimingpian_history_rongzi_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: '股权融资/转让',
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          round: '股权融资/转让',
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/2.png'),
        title: '定向增发',
        num: '2000家',
        span: 8,
        api: 'build_qimingpian_history_rongzi_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_qimingpian_history_rongzi_com_capital_range',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: '定向增发',
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_qimingpian_history_rongzi_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            round: '定向增发',
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          round: '定向增发',
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/2.png'),
        title: '对外投资企业',
        num: '2000家',
        span: 12,
        api: 'build_opt_ent_partner_std_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_opt_ent_partner_std_com_chart',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_opt_ent_partner_std_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/1.png'),
        title: '开设分支机构',
        num: '2000家',
        span: 12,
        api: 'build_company_branch_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_company_branch_com_chart',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            shpId: Number(this.$route.query.id),
            status: 1
          }
        }, {
          api: 'company_branch_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            shpId: Number(this.$route.query.id),
            status: 1
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          shpId: Number(this.$route.query.id),
          status: 1
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/2.png'),
        title: '购地企业',
        num: '2000家',
        span: 12,
        api: 'build_land_result_announcement_com_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_land_result_announcement_com_chart',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_land_result_announcement_com_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          shpId: Number(this.$route.query.id)
        }
      },
      {
        icon: require('@/assets/images/busNeighbors/1.png'),
        title: '招投标企业',
        num: '2000家',
        span: 12,
        api: 'build_company_ydzb_list',
        url: '/bus-neighbors/list',
        searchApi: [{
          api: 'build_company_ydzb_capital_range',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            shpId: Number(this.$route.query.id)
          }
        }, {
          api: 'build_company_ydzb_establish_range',
          exProperty: 'establishRange',
          params: {
            endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
            shpId: Number(this.$route.query.id)
          }
        }],
        params: {
          endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
          lyComType: 5,
          lyId: Number(this.$route.query.id),
          pageNumber: 1,
          pageSize: 10,
          shpId: Number(this.$route.query.id)
        }
      }],
      counts: [],
      loading: true
    }
  },
  async mounted() {
    Promise.all([
      await build_qimingpian_history_rongzi_com_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        shpId: Number(this.$route.query.id)
      }),
      await build_qimingpian_history_rongzi_type_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        round: '种子轮/天使轮',
        shpId: Number(this.$route.query.id)
      }),
      await build_qimingpian_history_rongzi_type_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        round: 'A轮',
        shpId: Number(this.$route.query.id)
      }),
      await build_qimingpian_history_rongzi_type_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        round: 'B轮',
        shpId: Number(this.$route.query.id)
      }),
      await build_qimingpian_history_rongzi_type_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        round: 'C轮',
        shpId: Number(this.$route.query.id)
      }),
      await build_qimingpian_history_rongzi_type_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        round: 'E轮及以上',
        shpId: Number(this.$route.query.id)
      }),
      await build_qimingpian_history_rongzi_type_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        round: '并购/合并',
        shpId: Number(this.$route.query.id)
      }),
      await build_qimingpian_history_rongzi_type_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        round: '战略融资/投资',
        shpId: Number(this.$route.query.id)
      }),
      await build_qimingpian_history_rongzi_type_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        round: '股权融资/转让',
        shpId: Number(this.$route.query.id)
      }),
      await build_qimingpian_history_rongzi_type_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        round: '定向增发',
        shpId: Number(this.$route.query.id)
      }),
      await build_opt_ent_partner_std_com_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        shpId: Number(this.$route.query.id)
      }),
      await build_company_branch_com_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        shpId: Number(this.$route.query.id),
        status: 1
      }),
      await build_land_result_announcement_com_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        shpId: Number(this.$route.query.id)
      }),
      await build_company_ydzb_count({
        endDate: this.$dayjs().endOf('month').format('YYYY-MM-DD'),
        shpId: Number(this.$route.query.id)
      })
    ]).then(res => {
      this.loading = false
      this.counts = res.map(item => item.data && (item.data.content.length && item.data.content[0].total) || 0)
    })
  },
  methods: {
    toUrl(item) {
      this.$router.push({ path: item.url, query: { data: JSON.stringify(item), companyNames: this.$route.query.name }})
    }
  }
}
</script>
    <style lang="scss" scoped>
    .existing {
      .list-box{
        width: 100%;
        padding-left: 20px;
      }
      .title{
        margin: 0 20px 20px 20px;
        width: calc(100% - 40px);
      }
      .classify{
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0 10px 10px;
        background: #FFFFFF;
        border-radius: 6px 6px 6px 6px;
        border: 1px solid #E8EAEC;
        margin-bottom: 20px;
        .right-icon{
          width: 14px;
          height: 14px;
        }
        img{
          width: 24px;
          height: 24px;
          margin-right: 10px;
        }
        div{
          display: flex;
          align-items: center;
          font-size: 13px;
          color: #000000;
        }
        .color-o {
          color: #FF8C1A;
        }
      }
      .con{
        width: 100%;
        border: 1px solid #E8EAEC;
        margin-bottom: 20px;
        // height: 300px;
        .m-tit{
          padding-left: 26px;
          font-weight: 700;
          font-family: PingFang SC, PingFang SC;
        }
      }
    }
    </style>
